dojo.declare("DVendorAccountNewPg", wm.Page, {
    start: function() {

      //  var mainPage = wm.Page.getPage("MobileMainPg");

      //  this.lvVendor.filter.setValue("customerId", mainPage.vUserId);

        this.lvVendor.update();

        // this.projectLookup1.setReadonly(true);
        //this.emailEditor.setReadonly(true);
    },
    "preferredDevice": "desktop",

 customerSaveButtonClick: function(inSender) {
        var shopTime1;
        var shopTime2;

        var openHr = this.optionTimeHour.dataValue;
        var openMin = this.optionTimeMin.dataValue;
        var openAmPm = this.option.dataValue;

        var openTime = true;

        var closeHr = this.optionTimeHour1.dataValue;
        var closeMin = this.optionTimeMin1.dataValue;
        var closeAmPm = this.option1.dataValue;
        var closeTime = true;

        var timeflag = false;
        if (openHr || openMin || openAmPm) {
            timeflag = true;
            if (!openHr || !openMin || !openAmPm) {
                openTime = false;
            } else {
                shopTime1 = openHr + ":" + openMin + " " + openAmPm;
            }
            closeTime = false;

        }
        if (closeHr || closeMin || closeAmPm) {
            if (!closeHr || !closeMin || !closeAmPm) {
                closeTime = false;
            } else {
                closeTime = true;
                shopTime1 = shopTime1 + "," + closeHr + ":" + closeMin + " " + closeAmPm;
            }

            if (!timeflag) {
                openTime = false;
            }
        }

        var openHr1 = this.optionTimeHour2.dataValue;
        var openMin1 = this.optionTimeMin2.dataValue;
        var openAmPm1 = this.option2.dataValue;

        var openTime1 = true;

        var closeHr1 = this.optionTimeHour3.dataValue;
        var closeMin1 = this.optionTimeMin3.dataValue;
        var closeAmPm1 = this.option3.dataValue;
        var closeTime1 = true;

        var timeflag1 = false;
        if (openHr1 || openMin1 || openAmPm1) {
            timeflag1 = true;
            if (!openHr1 || !openMin1 || !openAmPm1) {
                openTime1 = false;
            } else {
                shopTime2 = openHr1 + ":" + openMin1 + " " + openAmPm1;
            }
            closeTime1 = false;
        }
        if (closeHr1 || closeMin1 || closeAmPm1) {
            if (!closeHr1 || !closeMin1 || !closeAmPm1) {
                closeTime1 = false;
            } else {
                closeTime1 = true;
                shopTime2 = shopTime2 + "," + closeHr1 + ":" + closeMin1 + " " + closeAmPm1;
            }

            if (!timeflag1) {
                openTime1 = false;
            }
        }

        if ((openTime && closeTime) && (openTime1 && closeTime1)) {
            if (timeflag && timeflag1) {
                shopTime1 = shopTime1 + ";" + shopTime2;
            } else if (timeflag1) {
                shopTime1 = shopTime2;
            }
           // alert(shopTime1);
           
            this.shopTimeTxt.setDataValue(shopTime1);            
            this.liveForm1EditPanel.saveData();

        }
        else {
            // app.toastWarning("Please Enter Valid Timing", 4000);
            this.ncShopTime.update();
        }


    },
 customerUpdateButtonClick: function(inSender) {
        this.optionTimeHour.setDataValue("");
        this.optionTimeMin.setDataValue("");
        this.option.setDataValue("");

        this.optionTimeHour1.setDataValue("");
        this.optionTimeMin1.setDataValue("");
        this.option1.setDataValue("");

        this.optionTimeHour2.setDataValue("");
        this.optionTimeMin2.setDataValue("");
        this.option2.setDataValue("");

        this.optionTimeHour3.setDataValue("");
        this.optionTimeMin3.setDataValue("");
        this.option3.setDataValue("");

    },
    updateButton1Click1: function(inSender) {
        this.projectLookup1.setReadonly(true);
        this.emailEditor1.setReadonly(true);
    },
    _end: 0
});